{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "58fe7d56",
   "metadata": {},
   "source": [
    "# 1.请求页面准备\n",
    "- 1.找到页面的数据API接口\n",
    "- 2.提供正确的用户请求酬载\n",
    "- 3.准备请求的headers，增加cookie信息，保证数据合理性"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "35212075",
   "metadata": {},
   "source": [
    "# 翻页数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "3588a887",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response_df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d8d3f58f",
   "metadata": {},
   "source": [
    "# 3.数据整理成表格\n",
    "- concat方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "074288ce",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "No objects to concatenate",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Input \u001b[1;32mIn [6]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconcat\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresponse_df\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m      2\u001b[0m df\n",
      "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\pandas\\util\\_decorators.py:311\u001b[0m, in \u001b[0;36mdeprecate_nonkeyword_arguments.<locals>.decorate.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m    305\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(args) \u001b[38;5;241m>\u001b[39m num_allow_args:\n\u001b[0;32m    306\u001b[0m     warnings\u001b[38;5;241m.\u001b[39mwarn(\n\u001b[0;32m    307\u001b[0m         msg\u001b[38;5;241m.\u001b[39mformat(arguments\u001b[38;5;241m=\u001b[39marguments),\n\u001b[0;32m    308\u001b[0m         \u001b[38;5;167;01mFutureWarning\u001b[39;00m,\n\u001b[0;32m    309\u001b[0m         stacklevel\u001b[38;5;241m=\u001b[39mstacklevel,\n\u001b[0;32m    310\u001b[0m     )\n\u001b[1;32m--> 311\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
      "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\pandas\\core\\reshape\\concat.py:347\u001b[0m, in \u001b[0;36mconcat\u001b[1;34m(objs, axis, join, ignore_index, keys, levels, names, verify_integrity, sort, copy)\u001b[0m\n\u001b[0;32m    143\u001b[0m \u001b[38;5;129m@deprecate_nonkeyword_arguments\u001b[39m(version\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, allowed_args\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mobjs\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n\u001b[0;32m    144\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mconcat\u001b[39m(\n\u001b[0;32m    145\u001b[0m     objs: Iterable[NDFrame] \u001b[38;5;241m|\u001b[39m Mapping[Hashable, NDFrame],\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    154\u001b[0m     copy: \u001b[38;5;28mbool\u001b[39m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[0;32m    155\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m DataFrame \u001b[38;5;241m|\u001b[39m Series:\n\u001b[0;32m    156\u001b[0m     \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m    157\u001b[0m \u001b[38;5;124;03m    Concatenate pandas objects along a particular axis with optional set logic\u001b[39;00m\n\u001b[0;32m    158\u001b[0m \u001b[38;5;124;03m    along the other axes.\u001b[39;00m\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    345\u001b[0m \u001b[38;5;124;03m    ValueError: Indexes have overlapping values: ['a']\u001b[39;00m\n\u001b[0;32m    346\u001b[0m \u001b[38;5;124;03m    \"\"\"\u001b[39;00m\n\u001b[1;32m--> 347\u001b[0m     op \u001b[38;5;241m=\u001b[39m \u001b[43m_Concatenator\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m    348\u001b[0m \u001b[43m        \u001b[49m\u001b[43mobjs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    349\u001b[0m \u001b[43m        \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    350\u001b[0m \u001b[43m        \u001b[49m\u001b[43mignore_index\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mignore_index\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    351\u001b[0m \u001b[43m        \u001b[49m\u001b[43mjoin\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mjoin\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    352\u001b[0m \u001b[43m        \u001b[49m\u001b[43mkeys\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mkeys\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    353\u001b[0m \u001b[43m        \u001b[49m\u001b[43mlevels\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mlevels\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    354\u001b[0m \u001b[43m        \u001b[49m\u001b[43mnames\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mnames\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    355\u001b[0m \u001b[43m        \u001b[49m\u001b[43mverify_integrity\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mverify_integrity\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    356\u001b[0m \u001b[43m        \u001b[49m\u001b[43mcopy\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcopy\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    357\u001b[0m \u001b[43m        \u001b[49m\u001b[43msort\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43msort\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    358\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    360\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m op\u001b[38;5;241m.\u001b[39mget_result()\n",
      "File \u001b[1;32mD:\\Anaconda\\lib\\site-packages\\pandas\\core\\reshape\\concat.py:404\u001b[0m, in \u001b[0;36m_Concatenator.__init__\u001b[1;34m(self, objs, axis, join, keys, levels, names, ignore_index, verify_integrity, copy, sort)\u001b[0m\n\u001b[0;32m    401\u001b[0m     objs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(objs)\n\u001b[0;32m    403\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(objs) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m--> 404\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo objects to concatenate\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m    406\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m keys \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m    407\u001b[0m     objs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(com\u001b[38;5;241m.\u001b[39mnot_none(\u001b[38;5;241m*\u001b[39mobjs))\n",
      "\u001b[1;31mValueError\u001b[0m: No objects to concatenate"
     ]
    }
   ],
   "source": [
    "df = pd.concat(response_df)\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7f992019",
   "metadata": {},
   "source": [
    "# 4.数据分析\n",
    "\n",
    "- 1.Pandas/Numpy\n",
    "- 2.Pyecharts(bokeh，matplotlab，seaborn，echarts),更考虑用户的体验"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f710c646",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>dataInfo</th>\n",
       "      <th>dataParams</th>\n",
       "      <th>job.labels</th>\n",
       "      <th>job.refreshTime</th>\n",
       "      <th>job.title</th>\n",
       "      <th>job.salary</th>\n",
       "      <th>job.dq</th>\n",
       "      <th>job.jobId</th>\n",
       "      <th>job.topJob</th>\n",
       "      <th>...</th>\n",
       "      <th>comp.link</th>\n",
       "      <th>comp.compIndustry</th>\n",
       "      <th>comp.compScale</th>\n",
       "      <th>recruiter.recruiterName</th>\n",
       "      <th>recruiter.recruiterTitle</th>\n",
       "      <th>recruiter.imId</th>\n",
       "      <th>recruiter.imUserType</th>\n",
       "      <th>recruiter.chatted</th>\n",
       "      <th>recruiter.recruiterId</th>\n",
       "      <th>recruiter.recruiterPhoto</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>%7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...</td>\n",
       "      <td>{\"recruiterName\":\"梁女士\",\"jobId\":\"49036529\",\"imI...</td>\n",
       "      <td>[]</td>\n",
       "      <td>20230412095614</td>\n",
       "      <td>医药产品经理</td>\n",
       "      <td>15-20k</td>\n",
       "      <td>广州</td>\n",
       "      <td>49036529</td>\n",
       "      <td>True</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/2051572/</td>\n",
       "      <td>制药</td>\n",
       "      <td>1000-2000人</td>\n",
       "      <td>梁女士</td>\n",
       "      <td>NaN</td>\n",
       "      <td>d7754d4d4e4aa4da6dadb487287a091a</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>1cd0965588ebd1dba766278cd27a88c2</td>\n",
       "      <td>5bd962c38e50a3257f7c32d304a.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>%7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...</td>\n",
       "      <td>{\"recruiterName\":\"刘女士\",\"jobId\":\"58002363\",\"imI...</td>\n",
       "      <td>['产品开发', '产品规划', '产品运营']</td>\n",
       "      <td>20230421104505</td>\n",
       "      <td>电商产品经理</td>\n",
       "      <td>10-15k·13薪</td>\n",
       "      <td>广州-越秀区</td>\n",
       "      <td>58002363</td>\n",
       "      <td>True</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/9720899/</td>\n",
       "      <td>批发/零售</td>\n",
       "      <td>50-99人</td>\n",
       "      <td>刘女士</td>\n",
       "      <td>人事经理</td>\n",
       "      <td>561ff6e28a2e9cb4aa6795a3148228ff</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>e478580dede58f33b410edb79f6d12d0</td>\n",
       "      <td>5f8f986779c7cc70efbf36c008u.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>%7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...</td>\n",
       "      <td>{\"recruiterName\":\"王女士\",\"jobId\":\"56876529\",\"imI...</td>\n",
       "      <td>[]</td>\n",
       "      <td>20230510113709</td>\n",
       "      <td>Automation Product Manager</td>\n",
       "      <td>20-40k·13薪</td>\n",
       "      <td>广州-天河区</td>\n",
       "      <td>56876529</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/8506529/</td>\n",
       "      <td>医疗器械</td>\n",
       "      <td>5000-10000人</td>\n",
       "      <td>王女士</td>\n",
       "      <td>人力资源专员</td>\n",
       "      <td>24c1cab13ef9bc2e801c17c79e240538</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>57a52ed73fed146b4c632be0178bfd3f</td>\n",
       "      <td>5f8f98648dbe6273dcf8515508u.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>%7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...</td>\n",
       "      <td>{\"recruiterName\":\"李女士\",\"jobId\":\"58230073\",\"imI...</td>\n",
       "      <td>['支付产品', '工具产品', '供应链产品', '产品规划', '产品设计', '需求分...</td>\n",
       "      <td>20230429161907</td>\n",
       "      <td>支付结算产品经理（供应链）</td>\n",
       "      <td>20-40k·16薪</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>58230073</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/8537928/</td>\n",
       "      <td>消费品</td>\n",
       "      <td>5000-10000人</td>\n",
       "      <td>李女士</td>\n",
       "      <td>HR</td>\n",
       "      <td>01bdff5bdd175f73bed9c63c695716f7</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>4cb038ce180249e5b6d6f34ea69aacf8</td>\n",
       "      <td>62201c0397e97d36de7fadb308u.png</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>%7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...</td>\n",
       "      <td>{\"recruiterName\":\"李先生\",\"jobId\":\"44389755\",\"imI...</td>\n",
       "      <td>['工具产品', '海外产品']</td>\n",
       "      <td>20230504101816</td>\n",
       "      <td>项目负责人-出海工具</td>\n",
       "      <td>50-60k·18薪</td>\n",
       "      <td>广州</td>\n",
       "      <td>44389755</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>在线社交/媒体</td>\n",
       "      <td>100-499人</td>\n",
       "      <td>李先生</td>\n",
       "      <td>猎头顾问</td>\n",
       "      <td>a618aec32f807381e2a6e48d27d32952</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>7938d3385f4fa15e1077287a6124ac27</td>\n",
       "      <td>61c1856c1fe6ad2b061c38f408u.png</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>796</th>\n",
       "      <td>36</td>\n",
       "      <td>%7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...</td>\n",
       "      <td>{\"jobKind\":\"2\",\"imId\":\"e225c3f62a005d602599e94...</td>\n",
       "      <td>['AI人工智能产品', 'IT互联网', '人工智能', '用户研究', '需求分析', ...</td>\n",
       "      <td>20221125101339</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>14-17k</td>\n",
       "      <td>广州-天河区</td>\n",
       "      <td>54434179</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/13240331/</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>1-49人</td>\n",
       "      <td>杨女士</td>\n",
       "      <td>HR</td>\n",
       "      <td>e225c3f62a005d602599e94af0746e13</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>2e7227dee6993722f405701a339a50b5</td>\n",
       "      <td>62a44db9eb7f9e008716ed4208u.png</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>797</th>\n",
       "      <td>37</td>\n",
       "      <td>%7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...</td>\n",
       "      <td>{\"jobKind\":\"2\",\"imId\":\"1fe1f195fb9b578b4036597...</td>\n",
       "      <td>['产品经理', '智能硬件产品', '智能硬件', '车载产品', '行车记录仪']</td>\n",
       "      <td>20230426171852</td>\n",
       "      <td>高级产品经理（硬件产品）</td>\n",
       "      <td>20-30k</td>\n",
       "      <td>广州-越秀区</td>\n",
       "      <td>51415121</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/12274147/</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>100-499人</td>\n",
       "      <td>王女士</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1fe1f195fb9b578b4036597854bcf58c</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>3008edc8b1b12656a3c5bc684e468568</td>\n",
       "      <td>5f8f9865ea60860b75384fa508u.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>798</th>\n",
       "      <td>38</td>\n",
       "      <td>%7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...</td>\n",
       "      <td>{\"jobKind\":\"2\",\"imId\":\"694fd92f6c2e08c7e2ff452...</td>\n",
       "      <td>[]</td>\n",
       "      <td>20230209091607</td>\n",
       "      <td>护肤品产品开发经理</td>\n",
       "      <td>10-20k</td>\n",
       "      <td>广州-海珠区</td>\n",
       "      <td>55885211</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/13413369/</td>\n",
       "      <td>电子商务</td>\n",
       "      <td>50-99人</td>\n",
       "      <td>麦女士</td>\n",
       "      <td>人事</td>\n",
       "      <td>694fd92f6c2e08c7e2ff452aa21dd897</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>5c70ee4140549e39609440013bae28b2</td>\n",
       "      <td>5f8f9865ea60860b75384fa508u.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>799</th>\n",
       "      <td>39</td>\n",
       "      <td>%7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...</td>\n",
       "      <td>{\"jobKind\":\"2\",\"imId\":\"16c9e99cc7e10c1f062c1b1...</td>\n",
       "      <td>['电商产品', 'IT互联网', '电子商务', '产品设计', '移动端产品', '产品...</td>\n",
       "      <td>20220224164403</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>15-25k</td>\n",
       "      <td>广州</td>\n",
       "      <td>47448393</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/12677101/</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>1-49人</td>\n",
       "      <td>钟先生</td>\n",
       "      <td>人事经理</td>\n",
       "      <td>16c9e99cc7e10c1f062c1b1ee9c7454d</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>6b69b564e7d96f6957441703e35c1686</td>\n",
       "      <td>5f8f986aea60860b75384fab08u.jpg</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>800</th>\n",
       "      <td>0</td>\n",
       "      <td>%7B%22ckId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...</td>\n",
       "      <td>{\"userId\":\"3008edc8b1b12656a3c5bc684e468568\",\"...</td>\n",
       "      <td>['嵌入式硬件产品', '产品经理', '硬件产品经理', '硬件产品', '车载产品', ...</td>\n",
       "      <td>20230426171852</td>\n",
       "      <td>嵌入式硬件产品经理</td>\n",
       "      <td>20-30k</td>\n",
       "      <td>广州-越秀区</td>\n",
       "      <td>51414013</td>\n",
       "      <td>False</td>\n",
       "      <td>...</td>\n",
       "      <td>https://www.liepin.com/company/12274147/</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>100-499人</td>\n",
       "      <td>王女士</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1fe1f195fb9b578b4036597854bcf58c</td>\n",
       "      <td>2.0</td>\n",
       "      <td>False</td>\n",
       "      <td>3008edc8b1b12656a3c5bc684e468568</td>\n",
       "      <td>5f8f9865ea60860b75384fa508u.jpg</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>801 rows × 32 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Unnamed: 0                                           dataInfo  \\\n",
       "0             0  %7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...   \n",
       "1             1  %7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...   \n",
       "2             2  %7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...   \n",
       "3             3  %7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...   \n",
       "4             4  %7B%22skId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...   \n",
       "..          ...                                                ...   \n",
       "796          36  %7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...   \n",
       "797          37  %7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...   \n",
       "798          38  %7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...   \n",
       "799          39  %7B%22jobKind%22%3A%222%22%2C%22pageSize%22%3A...   \n",
       "800           0  %7B%22ckId%22%3A%22h2c8pxojavrmo1w785z7ueih2yb...   \n",
       "\n",
       "                                            dataParams  \\\n",
       "0    {\"recruiterName\":\"梁女士\",\"jobId\":\"49036529\",\"imI...   \n",
       "1    {\"recruiterName\":\"刘女士\",\"jobId\":\"58002363\",\"imI...   \n",
       "2    {\"recruiterName\":\"王女士\",\"jobId\":\"56876529\",\"imI...   \n",
       "3    {\"recruiterName\":\"李女士\",\"jobId\":\"58230073\",\"imI...   \n",
       "4    {\"recruiterName\":\"李先生\",\"jobId\":\"44389755\",\"imI...   \n",
       "..                                                 ...   \n",
       "796  {\"jobKind\":\"2\",\"imId\":\"e225c3f62a005d602599e94...   \n",
       "797  {\"jobKind\":\"2\",\"imId\":\"1fe1f195fb9b578b4036597...   \n",
       "798  {\"jobKind\":\"2\",\"imId\":\"694fd92f6c2e08c7e2ff452...   \n",
       "799  {\"jobKind\":\"2\",\"imId\":\"16c9e99cc7e10c1f062c1b1...   \n",
       "800  {\"userId\":\"3008edc8b1b12656a3c5bc684e468568\",\"...   \n",
       "\n",
       "                                            job.labels  job.refreshTime  \\\n",
       "0                                                   []   20230412095614   \n",
       "1                             ['产品开发', '产品规划', '产品运营']   20230421104505   \n",
       "2                                                   []   20230510113709   \n",
       "3    ['支付产品', '工具产品', '供应链产品', '产品规划', '产品设计', '需求分...   20230429161907   \n",
       "4                                     ['工具产品', '海外产品']   20230504101816   \n",
       "..                                                 ...              ...   \n",
       "796  ['AI人工智能产品', 'IT互联网', '人工智能', '用户研究', '需求分析', ...   20221125101339   \n",
       "797        ['产品经理', '智能硬件产品', '智能硬件', '车载产品', '行车记录仪']   20230426171852   \n",
       "798                                                 []   20230209091607   \n",
       "799  ['电商产品', 'IT互联网', '电子商务', '产品设计', '移动端产品', '产品...   20220224164403   \n",
       "800  ['嵌入式硬件产品', '产品经理', '硬件产品经理', '硬件产品', '车载产品', ...   20230426171852   \n",
       "\n",
       "                      job.title  job.salary  job.dq  job.jobId  job.topJob  \\\n",
       "0                        医药产品经理      15-20k      广州   49036529        True   \n",
       "1                        电商产品经理  10-15k·13薪  广州-越秀区   58002363        True   \n",
       "2    Automation Product Manager  20-40k·13薪  广州-天河区   56876529       False   \n",
       "3                 支付结算产品经理（供应链）  20-40k·16薪  广州-番禺区   58230073       False   \n",
       "4                    项目负责人-出海工具  50-60k·18薪      广州   44389755       False   \n",
       "..                          ...         ...     ...        ...         ...   \n",
       "796                        产品经理      14-17k  广州-天河区   54434179       False   \n",
       "797                高级产品经理（硬件产品）      20-30k  广州-越秀区   51415121       False   \n",
       "798                   护肤品产品开发经理      10-20k  广州-海珠区   55885211       False   \n",
       "799                        产品经理      15-25k      广州   47448393       False   \n",
       "800                   嵌入式硬件产品经理      20-30k  广州-越秀区   51414013       False   \n",
       "\n",
       "     ...                                 comp.link comp.compIndustry  \\\n",
       "0    ...   https://www.liepin.com/company/2051572/                制药   \n",
       "1    ...   https://www.liepin.com/company/9720899/             批发/零售   \n",
       "2    ...   https://www.liepin.com/company/8506529/              医疗器械   \n",
       "3    ...   https://www.liepin.com/company/8537928/               消费品   \n",
       "4    ...                                       NaN           在线社交/媒体   \n",
       "..   ...                                       ...               ...   \n",
       "796  ...  https://www.liepin.com/company/13240331/             计算机软件   \n",
       "797  ...  https://www.liepin.com/company/12274147/             计算机软件   \n",
       "798  ...  https://www.liepin.com/company/13413369/              电子商务   \n",
       "799  ...  https://www.liepin.com/company/12677101/             计算机软件   \n",
       "800  ...  https://www.liepin.com/company/12274147/             计算机软件   \n",
       "\n",
       "    comp.compScale recruiter.recruiterName  recruiter.recruiterTitle  \\\n",
       "0       1000-2000人                     梁女士                       NaN   \n",
       "1           50-99人                     刘女士                      人事经理   \n",
       "2      5000-10000人                     王女士                    人力资源专员   \n",
       "3      5000-10000人                     李女士                        HR   \n",
       "4         100-499人                     李先生                      猎头顾问   \n",
       "..             ...                     ...                       ...   \n",
       "796          1-49人                     杨女士                        HR   \n",
       "797       100-499人                     王女士                       NaN   \n",
       "798         50-99人                     麦女士                        人事   \n",
       "799          1-49人                     钟先生                      人事经理   \n",
       "800       100-499人                     王女士                       NaN   \n",
       "\n",
       "                       recruiter.imId recruiter.imUserType  recruiter.chatted  \\\n",
       "0    d7754d4d4e4aa4da6dadb487287a091a                  2.0              False   \n",
       "1    561ff6e28a2e9cb4aa6795a3148228ff                  2.0              False   \n",
       "2    24c1cab13ef9bc2e801c17c79e240538                  2.0              False   \n",
       "3    01bdff5bdd175f73bed9c63c695716f7                  2.0              False   \n",
       "4    a618aec32f807381e2a6e48d27d32952                  2.0              False   \n",
       "..                                ...                  ...                ...   \n",
       "796  e225c3f62a005d602599e94af0746e13                  2.0              False   \n",
       "797  1fe1f195fb9b578b4036597854bcf58c                  2.0              False   \n",
       "798  694fd92f6c2e08c7e2ff452aa21dd897                  2.0              False   \n",
       "799  16c9e99cc7e10c1f062c1b1ee9c7454d                  2.0              False   \n",
       "800  1fe1f195fb9b578b4036597854bcf58c                  2.0              False   \n",
       "\n",
       "                recruiter.recruiterId         recruiter.recruiterPhoto  \n",
       "0    1cd0965588ebd1dba766278cd27a88c2  5bd962c38e50a3257f7c32d304a.jpg  \n",
       "1    e478580dede58f33b410edb79f6d12d0  5f8f986779c7cc70efbf36c008u.jpg  \n",
       "2    57a52ed73fed146b4c632be0178bfd3f  5f8f98648dbe6273dcf8515508u.jpg  \n",
       "3    4cb038ce180249e5b6d6f34ea69aacf8  62201c0397e97d36de7fadb308u.png  \n",
       "4    7938d3385f4fa15e1077287a6124ac27  61c1856c1fe6ad2b061c38f408u.png  \n",
       "..                                ...                              ...  \n",
       "796  2e7227dee6993722f405701a339a50b5  62a44db9eb7f9e008716ed4208u.png  \n",
       "797  3008edc8b1b12656a3c5bc684e468568  5f8f9865ea60860b75384fa508u.jpg  \n",
       "798  5c70ee4140549e39609440013bae28b2  5f8f9865ea60860b75384fa508u.jpg  \n",
       "799  6b69b564e7d96f6957441703e35c1686  5f8f986aea60860b75384fab08u.jpg  \n",
       "800  3008edc8b1b12656a3c5bc684e468568  5f8f9865ea60860b75384fa508u.jpg  \n",
       "\n",
       "[801 rows x 32 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_excel('liepin_PM_0510.xlsx')\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c68127d8",
   "metadata": {},
   "source": [
    "## 查看表格的基本信息，查看数据列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "06e48ff2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 801 entries, 0 to 800\n",
      "Data columns (total 32 columns):\n",
      " #   Column                    Non-Null Count  Dtype  \n",
      "---  ------                    --------------  -----  \n",
      " 0   Unnamed: 0                801 non-null    int64  \n",
      " 1   dataInfo                  801 non-null    object \n",
      " 2   dataParams                801 non-null    object \n",
      " 3   job.labels                801 non-null    object \n",
      " 4   job.refreshTime           801 non-null    int64  \n",
      " 5   job.title                 801 non-null    object \n",
      " 6   job.salary                801 non-null    object \n",
      " 7   job.dq                    801 non-null    object \n",
      " 8   job.jobId                 801 non-null    int64  \n",
      " 9   job.topJob                801 non-null    bool   \n",
      " 10  job.jobKind               801 non-null    int64  \n",
      " 11  job.link                  801 non-null    object \n",
      " 12  job.requireWorkYears      801 non-null    object \n",
      " 13  job.requireEduLevel       801 non-null    object \n",
      " 14  job.pcOuterLink           0 non-null      float64\n",
      " 15  job.h5OuterLink           0 non-null      float64\n",
      " 16  job.dataPromId            801 non-null    object \n",
      " 17  job.advViewFlag           801 non-null    bool   \n",
      " 18  comp.compId               535 non-null    float64\n",
      " 19  comp.compStage            442 non-null    object \n",
      " 20  comp.compLogo             801 non-null    object \n",
      " 21  comp.compName             801 non-null    object \n",
      " 22  comp.link                 534 non-null    object \n",
      " 23  comp.compIndustry         800 non-null    object \n",
      " 24  comp.compScale            786 non-null    object \n",
      " 25  recruiter.recruiterName   801 non-null    object \n",
      " 26  recruiter.recruiterTitle  733 non-null    object \n",
      " 27  recruiter.imId            800 non-null    object \n",
      " 28  recruiter.imUserType      800 non-null    float64\n",
      " 29  recruiter.chatted         801 non-null    bool   \n",
      " 30  recruiter.recruiterId     800 non-null    object \n",
      " 31  recruiter.recruiterPhoto  801 non-null    object \n",
      "dtypes: bool(3), float64(4), int64(4), object(21)\n",
      "memory usage: 183.9+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b8199aa3",
   "metadata": {},
   "source": [
    "## 2.1筛选存在数据分析价值的列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "0f8a736e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>job.labels</th>\n",
       "      <th>job.refreshTime</th>\n",
       "      <th>job.title</th>\n",
       "      <th>job.salary</th>\n",
       "      <th>job.dq</th>\n",
       "      <th>job.topJob</th>\n",
       "      <th>job.requireWorkYears</th>\n",
       "      <th>job.requireEduLevel</th>\n",
       "      <th>comp.compName</th>\n",
       "      <th>comp.compIndustry</th>\n",
       "      <th>comp.compScale</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[]</td>\n",
       "      <td>20230412095614</td>\n",
       "      <td>医药产品经理</td>\n",
       "      <td>15-20k</td>\n",
       "      <td>广州</td>\n",
       "      <td>True</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>康芝药业股份有限公司</td>\n",
       "      <td>制药</td>\n",
       "      <td>1000-2000人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>['产品开发', '产品规划', '产品运营']</td>\n",
       "      <td>20230421104505</td>\n",
       "      <td>电商产品经理</td>\n",
       "      <td>10-15k·13薪</td>\n",
       "      <td>广州-越秀区</td>\n",
       "      <td>True</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>大专</td>\n",
       "      <td>广州愚记贸易有限公司</td>\n",
       "      <td>批发/零售</td>\n",
       "      <td>50-99人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>[]</td>\n",
       "      <td>20230510113709</td>\n",
       "      <td>Automation Product Manager</td>\n",
       "      <td>20-40k·13薪</td>\n",
       "      <td>广州-天河区</td>\n",
       "      <td>False</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>本科</td>\n",
       "      <td>丹纳赫</td>\n",
       "      <td>医疗器械</td>\n",
       "      <td>5000-10000人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>['支付产品', '工具产品', '供应链产品', '产品规划', '产品设计', '需求分...</td>\n",
       "      <td>20230429161907</td>\n",
       "      <td>支付结算产品经理（供应链）</td>\n",
       "      <td>20-40k·16薪</td>\n",
       "      <td>广州-番禺区</td>\n",
       "      <td>False</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>上海寻梦信息技术有限公司</td>\n",
       "      <td>消费品</td>\n",
       "      <td>5000-10000人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>['工具产品', '海外产品']</td>\n",
       "      <td>20230504101816</td>\n",
       "      <td>项目负责人-出海工具</td>\n",
       "      <td>50-60k·18薪</td>\n",
       "      <td>广州</td>\n",
       "      <td>False</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>某广州在线社交/媒体公司</td>\n",
       "      <td>在线社交/媒体</td>\n",
       "      <td>100-499人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>796</th>\n",
       "      <td>['AI人工智能产品', 'IT互联网', '人工智能', '用户研究', '需求分析', ...</td>\n",
       "      <td>20221125101339</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>14-17k</td>\n",
       "      <td>广州-天河区</td>\n",
       "      <td>False</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>本科</td>\n",
       "      <td>广州接入信息科技有限公司</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>1-49人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>797</th>\n",
       "      <td>['产品经理', '智能硬件产品', '智能硬件', '车载产品', '行车记录仪']</td>\n",
       "      <td>20230426171852</td>\n",
       "      <td>高级产品经理（硬件产品）</td>\n",
       "      <td>20-30k</td>\n",
       "      <td>广州-越秀区</td>\n",
       "      <td>False</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>大专</td>\n",
       "      <td>中视信息</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>100-499人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>798</th>\n",
       "      <td>[]</td>\n",
       "      <td>20230209091607</td>\n",
       "      <td>护肤品产品开发经理</td>\n",
       "      <td>10-20k</td>\n",
       "      <td>广州-海珠区</td>\n",
       "      <td>False</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>大专</td>\n",
       "      <td>广州娇肤兰科技有限公司</td>\n",
       "      <td>电子商务</td>\n",
       "      <td>50-99人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>799</th>\n",
       "      <td>['电商产品', 'IT互联网', '电子商务', '产品设计', '移动端产品', '产品...</td>\n",
       "      <td>20220224164403</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>15-25k</td>\n",
       "      <td>广州</td>\n",
       "      <td>False</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>大专</td>\n",
       "      <td>广东速狐信息科技有限公司</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>1-49人</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>800</th>\n",
       "      <td>['嵌入式硬件产品', '产品经理', '硬件产品经理', '硬件产品', '车载产品', ...</td>\n",
       "      <td>20230426171852</td>\n",
       "      <td>嵌入式硬件产品经理</td>\n",
       "      <td>20-30k</td>\n",
       "      <td>广州-越秀区</td>\n",
       "      <td>False</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>大专</td>\n",
       "      <td>中视信息</td>\n",
       "      <td>计算机软件</td>\n",
       "      <td>100-499人</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>801 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                            job.labels  job.refreshTime  \\\n",
       "0                                                   []   20230412095614   \n",
       "1                             ['产品开发', '产品规划', '产品运营']   20230421104505   \n",
       "2                                                   []   20230510113709   \n",
       "3    ['支付产品', '工具产品', '供应链产品', '产品规划', '产品设计', '需求分...   20230429161907   \n",
       "4                                     ['工具产品', '海外产品']   20230504101816   \n",
       "..                                                 ...              ...   \n",
       "796  ['AI人工智能产品', 'IT互联网', '人工智能', '用户研究', '需求分析', ...   20221125101339   \n",
       "797        ['产品经理', '智能硬件产品', '智能硬件', '车载产品', '行车记录仪']   20230426171852   \n",
       "798                                                 []   20230209091607   \n",
       "799  ['电商产品', 'IT互联网', '电子商务', '产品设计', '移动端产品', '产品...   20220224164403   \n",
       "800  ['嵌入式硬件产品', '产品经理', '硬件产品经理', '硬件产品', '车载产品', ...   20230426171852   \n",
       "\n",
       "                      job.title  job.salary  job.dq  job.topJob  \\\n",
       "0                        医药产品经理      15-20k      广州        True   \n",
       "1                        电商产品经理  10-15k·13薪  广州-越秀区        True   \n",
       "2    Automation Product Manager  20-40k·13薪  广州-天河区       False   \n",
       "3                 支付结算产品经理（供应链）  20-40k·16薪  广州-番禺区       False   \n",
       "4                    项目负责人-出海工具  50-60k·18薪      广州       False   \n",
       "..                          ...         ...     ...         ...   \n",
       "796                        产品经理      14-17k  广州-天河区       False   \n",
       "797                高级产品经理（硬件产品）      20-30k  广州-越秀区       False   \n",
       "798                   护肤品产品开发经理      10-20k  广州-海珠区       False   \n",
       "799                        产品经理      15-25k      广州       False   \n",
       "800                   嵌入式硬件产品经理      20-30k  广州-越秀区       False   \n",
       "\n",
       "    job.requireWorkYears job.requireEduLevel comp.compName comp.compIndustry  \\\n",
       "0                  5-10年                统招本科    康芝药业股份有限公司                制药   \n",
       "1                   1-3年                  大专    广州愚记贸易有限公司             批发/零售   \n",
       "2                  5-10年                  本科           丹纳赫              医疗器械   \n",
       "3                   1-3年                统招本科  上海寻梦信息技术有限公司               消费品   \n",
       "4                   3-5年               本科及以上  某广州在线社交/媒体公司           在线社交/媒体   \n",
       "..                   ...                 ...           ...               ...   \n",
       "796                 3-5年                  本科  广州接入信息科技有限公司             计算机软件   \n",
       "797                5-10年                  大专          中视信息             计算机软件   \n",
       "798                 3-5年                  大专   广州娇肤兰科技有限公司              电子商务   \n",
       "799                5-10年                  大专  广东速狐信息科技有限公司             计算机软件   \n",
       "800                5-10年                  大专          中视信息             计算机软件   \n",
       "\n",
       "    comp.compScale  \n",
       "0       1000-2000人  \n",
       "1           50-99人  \n",
       "2      5000-10000人  \n",
       "3      5000-10000人  \n",
       "4         100-499人  \n",
       "..             ...  \n",
       "796          1-49人  \n",
       "797       100-499人  \n",
       "798         50-99人  \n",
       "799          1-49人  \n",
       "800       100-499人  \n",
       "\n",
       "[801 rows x 11 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_PM_gz = df[['job.labels','job.refreshTime','job.title','job.salary','job.dq','job.topJob','job.requireWorkYears','job.requireEduLevel','comp.compName','comp.compIndustry','comp.compScale']]\n",
    "df_PM_gz"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e9d9bd11",
   "metadata": {},
   "source": [
    "## 2.2 广州的PM地区分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "adda8b23",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "广州        275\n",
       "广州-天河区    155\n",
       "广州-黄埔区    102\n",
       "广州-海珠区     76\n",
       "广州-番禺区     71\n",
       "广州-越秀区     46\n",
       "广州-白云区     43\n",
       "广州-南沙区     15\n",
       "广州-荔湾区      9\n",
       "广州-花都区      5\n",
       "广州-增城区      4\n",
       "Name: job.dq, dtype: int64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_PM_gz['job.dq'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "2ea98fc1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['天河区', '黄埔区', '海珠区', '番禺区', '越秀区', '白云区', '南沙区', '荔湾区', '花都区', '增城区']"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州地区 = [  i.split('-')[1]   for i in df_PM_gz['job.dq'].value_counts().index.tolist()[1:]]\n",
    "广州地区"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "15be54e4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[155, 102, 76, 71, 46, 43, 15, 9, 5, 4]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州岗位个数 = df_PM_gz['job.dq'].value_counts().values.tolist()[1:]\n",
    "广州岗位个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "0c850d05",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Defaulting to user installation because normal site-packages is not writeable\n",
      "Requirement already satisfied: pyecharts in c:\\users\\jenny\\appdata\\roaming\\python\\python39\\site-packages (2.0.3)\n",
      "Requirement already satisfied: jinja2 in d:\\anaconda\\lib\\site-packages (from pyecharts) (2.11.3)\n",
      "Requirement already satisfied: simplejson in c:\\users\\jenny\\appdata\\roaming\\python\\python39\\site-packages (from pyecharts) (3.19.1)\n",
      "Requirement already satisfied: prettytable in c:\\users\\jenny\\appdata\\roaming\\python\\python39\\site-packages (from pyecharts) (3.7.0)\n",
      "Requirement already satisfied: MarkupSafe>=0.23 in d:\\anaconda\\lib\\site-packages (from jinja2->pyecharts) (2.0.1)\n",
      "Requirement already satisfied: wcwidth in d:\\anaconda\\lib\\site-packages (from prettytable->pyecharts) (0.2.5)\n"
     ]
    }
   ],
   "source": [
    "!pip install pyecharts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "b9b69fe4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/v5/echarts.min', '广州':'https://assets.pyecharts.org/assets/v5/maps/guang3_dong1_guang3_zhou1'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"c529a66e6ac049ee89ae78ae6e0272c2\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', '广州'], function(echarts) {\n",
       "                var chart_c529a66e6ac049ee89ae78ae6e0272c2 = echarts.init(\n",
       "                    document.getElementById('c529a66e6ac049ee89ae78ae6e0272c2'), 'white', {renderer: 'canvas'});\n",
       "                var option_c529a66e6ac049ee89ae78ae6e0272c2 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"aria\": {\n",
       "        \"enabled\": false\n",
       "    },\n",
       "    \"color\": [\n",
       "        \"#5470c6\",\n",
       "        \"#91cc75\",\n",
       "        \"#fac858\",\n",
       "        \"#ee6666\",\n",
       "        \"#73c0de\",\n",
       "        \"#3ba272\",\n",
       "        \"#fc8452\",\n",
       "        \"#9a60b4\",\n",
       "        \"#ea7ccc\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"map\": \"\\u5e7f\\u5dde\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6cb3\\u533a\",\n",
       "                    \"value\": 155\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ec4\\u57d4\\u533a\",\n",
       "                    \"value\": 102\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u73e0\\u533a\",\n",
       "                    \"value\": 76\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u756a\\u79ba\\u533a\",\n",
       "                    \"value\": 71\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d8a\\u79c0\\u533a\",\n",
       "                    \"value\": 46\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u767d\\u4e91\\u533a\",\n",
       "                    \"value\": 43\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5357\\u6c99\\u533a\",\n",
       "                    \"value\": 15\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8354\\u6e7e\\u533a\",\n",
       "                    \"value\": 9\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u82b1\\u90fd\\u533a\",\n",
       "                    \"value\": 5\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u589e\\u57ce\\u533a\",\n",
       "                    \"value\": 4\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1,\n",
       "            \"borderRadius\": 0,\n",
       "            \"pageButtonItemGap\": 5,\n",
       "            \"pageButtonPosition\": \"end\",\n",
       "            \"pageFormatter\": \"{current}/{total}\",\n",
       "            \"pageIconColor\": \"#2f4554\",\n",
       "            \"pageIconInactiveColor\": \"#aaa\",\n",
       "            \"pageIconSize\": 15,\n",
       "            \"animationDurationUpdate\": 800,\n",
       "            \"selector\": false,\n",
       "            \"selectorPosition\": \"auto\",\n",
       "            \"selectorItemGap\": 7,\n",
       "            \"selectorButtonGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"enterable\": false,\n",
       "        \"confine\": false,\n",
       "        \"appendToBody\": false,\n",
       "        \"transitionDuration\": 0.4,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5,\n",
       "        \"order\": \"seriesAsc\"\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"text\": \"Map-\\u5e7f\\u5dde\\u5730\\u56fe\",\n",
       "            \"target\": \"blank\",\n",
       "            \"subtarget\": \"blank\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textAlign\": \"auto\",\n",
       "            \"textVerticalAlign\": \"auto\",\n",
       "            \"triggerEvent\": false\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"hoverLink\": true,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"padding\": 5,\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_c529a66e6ac049ee89ae78ae6e0272c2.setOption(option_c529a66e6ac049ee89ae78ae6e0272c2);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x24dac073d90>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Map\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c = (\n",
    "    Map()\n",
    "    .add(\"商家A\", [list(z) for z in zip(广州地区,广州岗位个数)], \"广州\")\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Map-广州地图\"), visualmap_opts=opts.VisualMapOpts()\n",
    "    )\n",
    "   \n",
    ")\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6427fc18",
   "metadata": {},
   "source": [
    "# 2.3职位分布\n",
    "- 知识点：dataframe的字符串处理\n",
    "> 使用series的str方式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "93b42dc1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0                          医药产品经理\n",
       "1                          电商产品经理\n",
       "2      Automation Product Manager\n",
       "3                   支付结算产品经理（供应链）\n",
       "4                      项目负责人-出海工具\n",
       "                  ...            \n",
       "796                          产品经理\n",
       "797                  高级产品经理（硬件产品）\n",
       "798                     护肤品产品开发经理\n",
       "799                          产品经理\n",
       "800                     嵌入式硬件产品经理\n",
       "Name: job.title, Length: 801, dtype: object"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_PM_gz['job.title']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "8c68f1c5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3           支付结算产品经理\n",
       "8               产品经理\n",
       "9               产品经理\n",
       "10              产品经理\n",
       "14            高级产品经理\n",
       "           ...      \n",
       "760    展业系统主任 / 产品经理\n",
       "764             产品经理\n",
       "770             产品经理\n",
       "784             产品经理\n",
       "797           高级产品经理\n",
       "Name: job.title, Length: 227, dtype: object"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_PM_gz['job.title'][  df_PM_gz['job.title'].str.contains('（')  ].str.split('（').apply(lambda x:x[0])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e99063f7",
   "metadata": {},
   "source": [
    "### 通过取值的方法去掉title的括号"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a5982fb0",
   "metadata": {},
   "source": [
    "### apply() 函数的自由度较高，可以直接对 Series 或者 DataFrame 中元素进行逐元素遍历操作。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "04bd19a7",
   "metadata": {},
   "source": [
    "## 还要合并回去原来的行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "7dfc9c59",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0                          医药产品经理\n",
       "1                          电商产品经理\n",
       "2      Automation Product Manager\n",
       "3                   支付结算产品经理（供应链）\n",
       "4                      项目负责人-出海工具\n",
       "                  ...            \n",
       "796                          产品经理\n",
       "797                  高级产品经理（硬件产品）\n",
       "798                     护肤品产品开发经理\n",
       "799                          产品经理\n",
       "800                     嵌入式硬件产品经理\n",
       "Name: job.title, Length: 801, dtype: object"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_PM_gz['job.title']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "4e93fc70",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'df_job_title' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[1;32mIn [18]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mdf_job_title\u001b[49m\u001b[38;5;241m.\u001b[39mindex\u001b[38;5;241m.\u001b[39mtolist()\n",
      "\u001b[1;31mNameError\u001b[0m: name 'df_job_title' is not defined"
     ]
    }
   ],
   "source": [
    "df_job_title.index.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "492908e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_job_title.values.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "831f183b",
   "metadata": {},
   "outputs": [],
   "source": [
    "### 未处理字符串的数据\n",
    "df_PM_gz['job.title'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e25a29d9",
   "metadata": {},
   "outputs": [],
   "source": [
    "### 处理过一些，清洗后的数据\n",
    "df_job_title = df_PM_gz['job.title'].apply(lambda x:x.split('(')[0].split('/')[0].split('（')[0]).value_counts()\n",
    "df_job_title"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c0ecbb66",
   "metadata": {},
   "source": [
    "### 列表推导式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "73aca956",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_title_words = [(  df_job_title.index.tolist()[i]  ,  df_job_title.values.tolist()[i]  )  for i in range(1,len(df_job_title.index.tolist())) ]\n",
    "df_title_words"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1917947d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "568b29bf",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'df_title_words' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[1;32mIn [19]\u001b[0m, in \u001b[0;36m<cell line: 6>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpyecharts\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcharts\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m WordCloud\n\u001b[0;32m      3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpyecharts\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mglobals\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m SymbolType\n\u001b[0;32m      5\u001b[0m c\u001b[38;5;241m=\u001b[39m(\n\u001b[0;32m      6\u001b[0m     WordCloud()\n\u001b[1;32m----> 7\u001b[0m     \u001b[38;5;241m.\u001b[39madd(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[43mdf_title_words\u001b[49m, word_size_range\u001b[38;5;241m=\u001b[39m[\u001b[38;5;241m20\u001b[39m, \u001b[38;5;241m100\u001b[39m],shape\u001b[38;5;241m=\u001b[39mSymbolType\u001b[38;5;241m.\u001b[39mDIAMOND)\n\u001b[0;32m      8\u001b[0m     \u001b[38;5;241m.\u001b[39mset_global_opts(title_opts\u001b[38;5;241m=\u001b[39mopts\u001b[38;5;241m.\u001b[39mTitleOpts(title\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mWordCloud-shape-dianond\u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[0;32m      9\u001b[0m     \u001b[38;5;241m.\u001b[39mrender(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwordcloud_diamond.html\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m     10\u001b[0m )\n\u001b[0;32m     11\u001b[0m c\n",
      "\u001b[1;31mNameError\u001b[0m: name 'df_title_words' is not defined"
     ]
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import WordCloud\n",
    "from pyecharts.globals import SymbolType\n",
    "\n",
    "c=(\n",
    "    WordCloud()\n",
    "    .add(\"\", df_title_words, word_size_range=[20, 100],shape=SymbolType.DIAMOND)\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='WordCloud-shape-dianond'))\n",
    "    .render('wordcloud_diamond.html')\n",
    ")\n",
    "c"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "327ab571",
   "metadata": {},
   "source": [
    "#### 数据产品经理，ai，ai应用"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1d90ac31",
   "metadata": {},
   "source": [
    "# job.labels分析\n",
    "- 标签定义了职能，任务是什么，要做什么。此职位具备的职能\n",
    "- 清楚该公司招什么人"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4cc052db",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_PM_gz['job.labels']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c99aca73",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_PM_gz['job.labels'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1498dfa2",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_PM_gz['job.labels'].apply(lambda x:eval(x)).values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1e08ac90",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_PM_gz['job.labels'].apply(lambda x:eval(x)).tolist() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "88d31c12",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 列表推导式\n",
    "[j    for i in df_PM_gz['job.labels'].apply(lambda x:eval(x)).tolist()      for j in i] # 将j取出来，列出来"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e7323abf",
   "metadata": {},
   "outputs": [],
   "source": [
    "PM_labels_list=[j    for i in df_PM_gz['job.labels'].apply(lambda x:eval(x)).tolist()      for j in i] \n",
    "PM_labels_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b5a4d0e4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 创建words\n",
    "[(i,PM_labels_list.count(i)) for i in set(PM_labels_list)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e4ca225e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4348a1df",
   "metadata": {},
   "outputs": [],
   "source": [
    "PM_labels_words = [(i,PM_labels_list.count(i)) for i in set(PM_labels_list)]\n",
    "PM_labels_words"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0c71fd9f",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import WordCloud\n",
    "from pyecharts.globals import SymbolType\n",
    "\n",
    "c=(\n",
    "    WordCloud()\n",
    "    .add(\"\", PM_labels_words, word_size_range=[20, 100],shape=SymbolType.DIAMOND)\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='WordCloud-shape-dianond'))\n",
    "    .render('wordcloud_diamond.html')\n",
    ")\n",
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1c737629",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import WordCloud\n",
    "from pyecharts.globals import SymbolType\n",
    "\n",
    "name = [\n",
    "    'Sam S Club', 'Macys', 'Amy Schumer', 'Jurassic World', 'Charter Communications',\n",
    "    'Chick Fil A', 'Planet Fitness', 'Pitch Perfect', 'Express', 'Home', 'Johnny Depp',\n",
    "    'Lena Dunham', 'Lewis Hamilton', 'KXAN', 'Mary Ellen Mark', 'Farrah Abraham',\n",
    "    'Rita Ora', 'Serena Williams', 'NCAA baseball tournament', 'Point Break']\n",
    "value = [\n",
    "    10000, 6181, 4386, 4055, 2467, 2244, 1898, 1484, 1112,\n",
    "    965, 847, 582, 555, 550, 462, 366, 360, 282, 273, 265]\n",
    "\n",
    "WordCloud.add(\"\", name, value, word_size_range=[20, 100])\n",
    "wordcloud.render()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2f4dbdb0",
   "metadata": {},
   "source": [
    "# 分组分析"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "194f908a",
   "metadata": {},
   "source": [
    "# 基本图表：关系图，关系图表。知识网络图谱\n",
    "- 相关性分析"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "73617027",
   "metadata": {},
   "source": [
    "# 薪资\n",
    "- 清除薪资面议，计算平均薪资\n",
    "- 直方图可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "73e0ee52",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# columns的重命名\n",
    "df_PM_gz = df_PM_gz.rename(columns={\n",
    "    'job.labels':'职位标签',\n",
    "    'job.refreshTime':'职位更新时间',\n",
    "    'job.title':'职位',\n",
    "    'job.salary':'薪资',\n",
    "    'job.dq':'地区',\n",
    "    'job.topJob':'是否top职位',\n",
    "    'job.requireWorkYears':'工作年限',\n",
    "    'job.requireEduLevel':'学历',\n",
    "    'comp.compStage':'公司融资情况',\n",
    "    'comp.compName':'公司名称',\n",
    "    'comp.compIndustry':'行业',\n",
    "    'comp.compScale':'规模'\n",
    "})\n",
    "df_PM_gz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "97f78402",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议 = df_PM_gz.query('薪资 != \"薪资面议\" and 薪资 != \"面议\"')\n",
    "非薪资面议"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ce797a43",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议_detail = 非薪资面议['薪资'].apply(lambda x:x.split('薪')[0].split('·')).tolist()\n",
    "非薪资面议_detail"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "40eeb5de",
   "metadata": {},
   "outputs": [],
   "source": [
    "(10+15)/2*13/12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d83a34ea",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 重要"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c575b1a6",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name '非薪资面议_detail' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[1;32mIn [3]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m 平均薪资 \u001b[38;5;241m=\u001b[39m [(\u001b[38;5;28mint\u001b[39m(i[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-\u001b[39m\u001b[38;5;124m'\u001b[39m)[\u001b[38;5;241m0\u001b[39m]) \u001b[38;5;241m+\u001b[39m\u001b[38;5;28mint\u001b[39m(i[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-\u001b[39m\u001b[38;5;124m'\u001b[39m)[\u001b[38;5;241m1\u001b[39m]\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mk\u001b[39m\u001b[38;5;124m'\u001b[39m)[\u001b[38;5;241m0\u001b[39m]))\u001b[38;5;241m/\u001b[39m\u001b[38;5;241m2\u001b[39m   \\\n\u001b[0;32m      2\u001b[0m  \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(i)\u001b[38;5;241m==\u001b[39m\u001b[38;5;241m1\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28mround\u001b[39m((\u001b[38;5;28mint\u001b[39m(i[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-\u001b[39m\u001b[38;5;124m'\u001b[39m)[\u001b[38;5;241m0\u001b[39m]) \u001b[38;5;241m+\u001b[39m \u001b[38;5;28mint\u001b[39m(i[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-\u001b[39m\u001b[38;5;124m'\u001b[39m)[\u001b[38;5;241m1\u001b[39m]\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mk\u001b[39m\u001b[38;5;124m'\u001b[39m)[\u001b[38;5;241m0\u001b[39m]))\u001b[38;5;241m/\u001b[39m\u001b[38;5;241m2\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;28mint\u001b[39m(i[\u001b[38;5;241m1\u001b[39m])\u001b[38;5;241m/\u001b[39m\u001b[38;5;241m12\u001b[39m,\u001b[38;5;241m1\u001b[39m)    \\\n\u001b[1;32m----> 3\u001b[0m  \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[43m非薪资面议_detail\u001b[49m\n\u001b[0;32m      4\u001b[0m     \n\u001b[0;32m      5\u001b[0m ]\n\u001b[0;32m      6\u001b[0m 平均薪资\n",
      "\u001b[1;31mNameError\u001b[0m: name '非薪资面议_detail' is not defined"
     ]
    }
   ],
   "source": [
    "平均薪资 = [(int(i[0].split('-')[0]) +int(i[0].split('-')[1].split('k')[0]))/2   \\\n",
    " if len(i)==1 else round((int(i[0].split('-')[0]) + int(i[0].split('-')[1].split('k')[0]))/2*int(i[1])/12,1)    \\\n",
    " for i in 非薪资面议_detail\n",
    "    \n",
    "]\n",
    "平均薪资"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f8ff02a5",
   "metadata": {},
   "outputs": [],
   "source": [
    "len(平均薪资)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7a2c2848",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议['平均薪资']=平均薪资"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "97d6d779",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "87a9834e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 地区平均薪资\n",
    "非薪资面议.groupby('地区').agg({'平均薪资':'mean'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7f6479d4",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议.groupby('工作年限').agg({'平均薪资':'mean'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bcd522cb",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议.groupby('学历').agg({'平均薪资':'mean'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2568079d",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议.groupby(['学历','工作年限']).agg({'平均薪资':'mean'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1a507d7b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 不同行业的平均薪资\n",
    "非薪资面议.groupby('行业').agg({'平均薪资':'mean'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a158e0c",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "11fab75e",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议.groupby('行业').agg({'平均薪资':'median'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a7b2503",
   "metadata": {},
   "outputs": [],
   "source": [
    "分地区_平均薪资_values = [round(i[0],1) for i in 分地区_平均薪资.values.tolist()]\n",
    "分地区_平均薪资_values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "136c3d9a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d601be7c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5a6b47dd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "97b78a65",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c=(\n",
    "    Bar()\n",
    "    .add_xaxis(\"\", df_title_words, word_size_range=[20, 100],shape=SymbolType.DIAMOND)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title='WordCloud-shape-dianond'))\n",
    "    .render('wordcloud_diamond.html')\n",
    ")\n",
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "819e5c89",
   "metadata": {},
   "outputs": [],
   "source": [
    "非薪资面议.groupby('工作年限').agg({'平均薪资':'median'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d9a67974",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "be724bbb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fb12cfe7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f88ca77b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2327f09c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
